<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>布局</title>

    <style>

        div.nav{
            display: flex;
        }
        div.nav1{
            display: flex;
        }
        .nav div{
            background: linear-gradient(to right,red,pink);
            width: 40%;
            height: 100px;
            display: inline-block;
            margin: 30px;
            border: 10px solid;
            padding: 20;
     /* 包含内边距和边框在宽度计算中 */
            font-size: 0;

            
        }

        .nav1 div{
            background: linear-gradient(to right,red,pink);
            width: 50%;
            height: 100px;

     /* 包含内边距和边框在宽度计算中 */
            font-size: 0;

            
        }

        .box1{
            background: linear-gradient(to right,pink,blue);

            width: 100px;
            height: 100px;
            display: inline;
        }

        .test{

            background-color: yellowgreen;
            width: 200px;
            height: 200px;
            /* 顺序是上右下左 顺时针*/
            margin-left: 25%;
            border: 10px solid hotpink;
            padding-top: 30px;
            padding-left: 30px;
            /* border-box是所有计算在内 content-box是计算内部+边框+内边距 */
            box-sizing: border-box;
        }


    </style>
</head>
<body>

    <div class="test">

        <input type="text"><label>输入</label>
    </div>

    <!-- 盒子模型
    context内容
    padding 内边距
    border 边框
    margin 外边距 
    
    
    -->

    <div class="nav1">

        <div>
            <div class="nav">1</div>
            <div class="nav">2</div>
        </div>
        
        <div class="nav">4</div>

    </div>

    <div class="nav">

        <div class="nav">1</div>
        <div class="nav">2</div>
        <div class="nav">3</div>
        <div class="nav">4</div>

    </div>
    <!-- 块元素 占一行,高根据元素决定-->
    <div class="box1">123456</div>
    <div class="box2">123456</div>

    <!-- 行内元素,在一行当中排布大小,根据区块元素的大小绝对大小 -->
    <span>123</span>
    <span>456</span>
</body>
</html>